package com.gulimall.auth.vo;

import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @Description
 * @Author lhj
 * @Date 2024/3/2 15:16
 */

@Builder
@EqualsAndHashCode
@ToString
@Data
@Accessors(chain = true)
public class UserRegisterVo {

    @NotEmpty(message = "用户名不能为空")
    @Size(min = 6, max = 18, message = "用户名必须在6-18字之间")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Size(min = 6, max = 18, message = "密码长度必须在6-18字之间")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "手机验证码不能为空")
    private String code;

}
